/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package es.esi.gemde.vv.mast.mastmodel.provider;


import es.esi.gemde.vv.mast.mastmodel.Character_Packet_Driver;
import es.esi.gemde.vv.mast.mastmodel.ModelPackage;

import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

/**
 * This is the item provider adapter for a {@link es.esi.gemde.vv.mast.mastmodel.Character_Packet_Driver} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class Character_Packet_DriverItemProvider
	extends ItemProviderAdapter
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Character_Packet_DriverItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

			addCharacter_Receive_OperationPropertyDescriptor(object);
			addCharacter_Send_OperationPropertyDescriptor(object);
			addCharacter_ServerPropertyDescriptor(object);
			addCharacter_Transmission_TimePropertyDescriptor(object);
			addMessage_PartitioningPropertyDescriptor(object);
			addPacket_Receive_OperationPropertyDescriptor(object);
			addPacket_Send_OperationPropertyDescriptor(object);
			addPacket_ServerPropertyDescriptor(object);
			addRTA_Overhead_ModelPropertyDescriptor(object);
		}
		return itemPropertyDescriptors;
	}

	/**
	 * This adds a property descriptor for the Character Receive Operation feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCharacter_Receive_OperationPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_Character_Receive_Operation_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_Character_Receive_Operation_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__CHARACTER_RECEIVE_OPERATION,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Character Send Operation feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCharacter_Send_OperationPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_Character_Send_Operation_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_Character_Send_Operation_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__CHARACTER_SEND_OPERATION,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Character Server feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCharacter_ServerPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_Character_Server_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_Character_Server_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__CHARACTER_SERVER,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Character Transmission Time feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCharacter_Transmission_TimePropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_Character_Transmission_Time_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_Character_Transmission_Time_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__CHARACTER_TRANSMISSION_TIME,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.REAL_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Message Partitioning feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addMessage_PartitioningPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_Message_Partitioning_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_Message_Partitioning_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__MESSAGE_PARTITIONING,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Packet Receive Operation feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addPacket_Receive_OperationPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_Packet_Receive_Operation_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_Packet_Receive_Operation_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__PACKET_RECEIVE_OPERATION,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Packet Send Operation feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addPacket_Send_OperationPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_Packet_Send_Operation_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_Packet_Send_Operation_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__PACKET_SEND_OPERATION,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Packet Server feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addPacket_ServerPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_Packet_Server_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_Packet_Server_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__PACKET_SERVER,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the RTA Overhead Model feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addRTA_Overhead_ModelPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_Character_Packet_Driver_RTA_Overhead_Model_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_Character_Packet_Driver_RTA_Overhead_Model_feature", "_UI_Character_Packet_Driver_type"),
				 ModelPackage.Literals.CHARACTER_PACKET_DRIVER__RTA_OVERHEAD_MODEL,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This returns Character_Packet_Driver.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/Character_Packet_Driver"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		String label = ((Character_Packet_Driver)object).getCharacter_Receive_Operation();
		return label == null || label.length() == 0 ?
			getString("_UI_Character_Packet_Driver_type") :
			getString("_UI_Character_Packet_Driver_type") + " " + label;
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(Character_Packet_Driver.class)) {
			case ModelPackage.CHARACTER_PACKET_DRIVER__CHARACTER_RECEIVE_OPERATION:
			case ModelPackage.CHARACTER_PACKET_DRIVER__CHARACTER_SEND_OPERATION:
			case ModelPackage.CHARACTER_PACKET_DRIVER__CHARACTER_SERVER:
			case ModelPackage.CHARACTER_PACKET_DRIVER__CHARACTER_TRANSMISSION_TIME:
			case ModelPackage.CHARACTER_PACKET_DRIVER__MESSAGE_PARTITIONING:
			case ModelPackage.CHARACTER_PACKET_DRIVER__PACKET_RECEIVE_OPERATION:
			case ModelPackage.CHARACTER_PACKET_DRIVER__PACKET_SEND_OPERATION:
			case ModelPackage.CHARACTER_PACKET_DRIVER__PACKET_SERVER:
			case ModelPackage.CHARACTER_PACKET_DRIVER__RTA_OVERHEAD_MODEL:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public ResourceLocator getResourceLocator() {
		return MastModelEditPlugin.INSTANCE;
	}

}
